import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { VehicleTrajectoryVO, VehicleTrajectoryForm, VehicleTrajectoryQuery } from '@/api/painting/vehicleTrajectory/types';

/**
 * 查询车辆轨迹信息列表
 * @param query
 * @returns {*}
 */

export const listVehicleTrajectory = (query?: VehicleTrajectoryQuery): AxiosPromise<VehicleTrajectoryVO[]> => {
  return request({
    url: '/painting/vehicleTrajectory/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询车辆轨迹信息详细
 * @param id
 */
export const getVehicleTrajectory = (id: string | number): AxiosPromise<VehicleTrajectoryVO> => {
  return request({
    url: '/painting/vehicleTrajectory/' + id,
    method: 'get'
  });
};

/**
 * 新增车辆轨迹信息
 * @param data
 */
export const addVehicleTrajectory = (data: VehicleTrajectoryForm) => {
  return request({
    url: '/painting/vehicleTrajectory',
    method: 'post',
    data: data
  });
};

/**
 * 修改车辆轨迹信息
 * @param data
 */
export const updateVehicleTrajectory = (data: VehicleTrajectoryForm) => {
  return request({
    url: '/painting/vehicleTrajectory',
    method: 'put',
    data: data
  });
};

/**
 * 删除车辆轨迹信息
 * @param id
 */
export const delVehicleTrajectory = (id: string | number | Array<string | number>) => {
  return request({
    url: '/painting/vehicleTrajectory/' + id,
    method: 'delete'
  });
};
